//
//  LGCanceSymptomEmptyCell.m
//  HeartDiseaseManage
//
//  Created by 1234 on 2024/7/24.
//

#import "LGCanceSymptomEmptyCell.h"

@interface LGCanceSymptomEmptyCell()
/**   */
@property (nonatomic , assign)CGFloat itemW;

@end

@implementation LGCanceSymptomEmptyCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.type = LGPositionTypeSingle;
        self.itemW = (Screen_W-viewPix(32))/6.0;
        UIButton *titleBtn = [UIButton buttonWithTitle:@" 患者未填写详细信息" titleFont:LGFont(14) textColor:@"#909399" imageName:@"电话随访-惊叹号"];
        titleBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
        titleBtn.frame = CGRectMake(viewPix(12), viewPix(8), viewPix(180), viewPix(22));
        [self.baseView addSubview:titleBtn];
        
        CGFloat left = 0;
        left = [self itemViewWithTitle:@"频次" left:left itemW:self.itemW-viewPix(5)];
        left = [self itemViewWithTitle:@"持续时长" left:left itemW:self.itemW+viewPix(12)];
        left = [self itemViewWithTitle:@"位置" left:left itemW:self.itemW-viewPix(5)];
        left = [self itemViewWithTitle:@"痰液性状" left:left itemW:self.itemW+viewPix(13)];
        left = [self itemViewWithTitle:@"量" left:left itemW:self.itemW-viewPix(10)];
        left = [self itemViewWithTitle:@"体温" left:left itemW:self.itemW-viewPix(5)];
        [self.baseView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.contentView).offset(viewPix(8));
            make.bottom.equalTo(self.contentView).offset(-viewPix(8));
            make.left.equalTo(self.contentView).offset(viewPix(16));
            make.right.equalTo(self.contentView).offset(-viewPix(16));
            make.height.equalTo(@(viewPix(90)));
        }];
    }
    return  self;
}

-(CGFloat)itemViewWithTitle:(NSString *)title left:(CGFloat)left itemW:(CGFloat)itemW{
    UILabel *titleLabel = [UILabel lableWithText:title colorString:@"#606266" textFont:LGFont(14) textAlignment:NSTextAlignmentCenter lines:1];
    titleLabel.frame = CGRectMake(left, viewPix(32), itemW, viewPix(22));
    [self.baseView addSubview:titleLabel];
    UILabel *contentLabel = [UILabel lableWithText:@"--" colorString:@"#282828" textFont:LGFont(15) textAlignment:NSTextAlignmentCenter lines:1];
    [self.baseView addSubview:contentLabel];
    [contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(titleLabel.mas_bottom).offset(viewPix(4));
        make.centerX.equalTo(titleLabel);
        make.width.equalTo(titleLabel);
        make.height.equalTo(@(viewPix(22)));
    }];
    left += itemW;
    return left;
}

@end

